package com.mzy.datepackage.M2022.Aug.thirty_first.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mzy.datepackage.M2022.Aug.thirty_first.service.Service;

import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/8/31 15:13
 * @Version 1.0
 */
public class Test {
    public final static String path ="F:\\每日脚本暂存\\新建文件路径\\2022.08.31\\service.json";

    public static void main(String[] args) {
        try {
            String string = FileUtil.readStringFromFile(path);
            System.out.println(string);
            JSONObject jsonObject = JSON.parseObject(string);
            Service service = JSON.parseObject(JSON.toJSONString(jsonObject), Service.class);
            String jsonString = JSON.toJSONString(service,true);
            System.out.println("java字符串》》"+jsonString);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
